<?php

class Application_Form_Datacenter extends Zend_Form
{

    public function init()
    {

        $this->setMethod('post');
		$this->setAttrib('id', 'ajax_form');


		$this->setDecorators(
			array(	"FormElements",
					array("HtmlTag", array("tag" => "table")),
					"Form"
			)
		);

		

        $nombre=new Zend_Form_Element_Text('nombre');
        $nombre ->setLabel('Nombre')
                ->setRequired(true)
                ->addFilter('StringTrim')
                ->addValidator('StringLength', false,array(0, 20));
                
                
                 
                
        
        $ini=new Zend_Form_Element_Text('ini');
        $ini->setLabel('Siglas:')
            ->setRequired(true)
            ->addFilters(array('StringToUpper','StringTrim'))
            ->addValidator('StringLength', false,array(0, 4));
            
        $direccion=new Zend_Form_Element_TextArea('datos');
        $direccion ->setLabel('Datos')
                ->setAttribs(array('rows'=>3,'cols'=>40))
                ->addFilter('StringTrim');  
            

        $dc=new Zend_Form_Element_Checkbox('dc');
        $dc->setLabel('Datacenter:')->addFilter('Boolean');

        $co=new Zend_Form_Element_Checkbox('co');
        $co->setLabel('Centro de Operación:')->addFilter('Boolean');
        
        $ct=new Zend_Form_Element_Checkbox('ct');
        $ct->setLabel('Centro de Trabajo:')->addFilter('Boolean');



		$this->addElement($nombre)
			 ->addElement($ini)
             ->addElement($dc)
             ->addElement($co)
             ->addElement($ct)
             ->addElement($direccion);
        
        
       $this->setElementDecorators(array(
		    'ViewHelper',
		   'Errors',
		    array(array('data' => 'HtmlTag'),	array('tag' => 'td', 'class' => 'element')   ),
		    array('Label', array('tag' => 'td')),
		    array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
		));
 
    }
}
